package car.activities;

import car.manager.R;
import car.manager.UserProfile;
import car.manager.R.id;
import car.manager.R.layout;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ProfileManagerActivity extends Activity{

	TextView profile_name;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.profile_manager);

		setDisplayName();

		Button button_bc = (Button) findViewById(R.id.button_buy_car);
		Button button_ag = (Button) findViewById(R.id.button_add_garage);
		Button button_eg = (Button) findViewById(R.id.button_enter_garage);
		Button button_er = (Button) findViewById(R.id.button_enter_race);

		Button button_exit = (Button) findViewById(R.id.button_exit);

		button_exit.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				
				backToMain();
			}

			
		});


	}

	private void setDisplayName() {
		profile_name=new TextView(this);
		profile_name=(TextView)findViewById(R.id.usernameDisplay); 
		if(UserProfile.getCurrentUserProfile()!=null)
			profile_name.setText(UserProfile.getCurrentUserProfile().getName().toString());		
		else
			profile_name.setText("You shouldn't be here....");	
	}

	private void backToMain() {
		Intent exit = new Intent(this, CarManagerActivity.class);
		startActivity(exit);				
	}
	
	
}
